<?php
class  ApiCenter_SalesApi_Model_Api2_Orderapi_Orderwarehouse  extends  Mage_Api2_Model_Resource {
    
    
    

    /**
     * Retrieve a list or orders' items in a form of [order ID => array of items, ...]
     *
     * @param array $orderIds Orders identifiers
     * @return array
     */
    protected function _getItems(array $orderIds)
    {
        $items = array();
           $helper = Mage::helper("salesapi");
        if ($this->_isSubCallAllowed('orderapi_orderwarehouse')) {
            /** @var $itemsFilter Mage_Api2_Model_Acl_Filter */
            $itemsFilter = $this->_getSubModel('orderapi_orderwarehouse', array())->getFilter();
            // do items request if at least one attribute allowed
            if ($itemsFilter->getAllowedAttributes()) {
                /* @var $collection Mage_Sales_Model_Resource_Order_Item_Collection */
                $collection = Mage::getResourceModel('salesapi/order_item_collection');
    
                $collection->addFieldToFilter('order_id', $orderIds);
                $i=0;;
                foreach ($collection->getItems() as $item) {
                    $items[$i] = $itemsFilter->out($item->toArray());
                    $items[$i]['img_url'] =$helper->_loadImgUrl($item->getSku());
                    $i++;
                }
            }
        }
        return $items;
    }
  
}